﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for QuangCaoBUS
/// </summary>
public class QuangCaoBUS
{
	private QuangCaoDAO objQuangCaoDAO;
    public QuangCaoBUS(string strPath)
    {
        objQuangCaoDAO = new QuangCaoDAO(strPath);
    }
    public DataSet SelectQuangCaoAll()
    {
        DataSet ds;
        try
        {
            ds = objQuangCaoDAO.SelectQuangCaoAll();
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }
    public DataSet SelectQuangCao(int id)
    {
        DataSet ds;
        try
        {
            ds = objQuangCaoDAO.SelectQuangCao(id);
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }
    public DataSet SelectQuangCaoByViTri(int vitri)
    {
        DataSet ds;
        try
        {
            ds = objQuangCaoDAO.SelectQuangCaoByViTri(vitri);
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }
    public Boolean InsertQuangCao(QuangCaoDTO qc)
    {
        try
        {
            return objQuangCaoDAO.InsertQuangCao(qc);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }

    public Boolean UpdateQuangCao(QuangCaoDTO qc, int type)
    {
        try
        {
            return objQuangCaoDAO.UpdateQuangCao(qc, type);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }

    public Boolean DeleteQuangCao(int id)
    {
        try
        {
            return objQuangCaoDAO.DeleteQuangCao(id);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }
}
